/*
 * Copyright 2014 netfinworks.com, Inc. All rights reserved.
 */
package org.rency.mq.activemq.listener.failover.impl;

import org.rency.mq.activemq.listener.failover.FailoverService;
import org.rency.mq.activemq.request.MQRequest;

/**
 * <p></p>
 *
 * @author zhangjiewen
 * @version $Id: BrokerFailoverServiceImpl.java, v 0.1 14-2-11 下午4:23 zhangjiewen Exp $
 */
public class BrokerFailoverServiceImpl implements FailoverService {
    @Override
    public void retry(MQRequest request) {
        Throwable t = (Throwable)request.getProperty("_exception");
        throw new RuntimeException("Throw exception and follow broker's failover policy.",t);
    }

    @Override
    public void retry(Object request, int retryTimes, String retryQueue, String failedQueue) {
        throw new RuntimeException("Throw exception and follow broker's failover policy.");
    }
}
